<?
session_start();
//echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
   
//echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
//   "http://www.w3.org/TR/html4/loose.dtd">';
$this_server = strip_tags($_SERVER[SERVER_NAME]);
$this_host = strip_tags($_SERVER[HTTP_HOST]);

if (strlen(trim($this_host))>0)
	{
	$title_replace = "." . $this_server;
	$thistitle = str_replace($title_replace,"",$this_host);
	}
else
	{
	$thistitle = $this_server; 
	}

$thisurl = "http://". $this_host;

if ($_GET[iframe]=="true")
    {
    if ($_GET[fullscreen]=="true")
       {       
       echo "<html style='height:100%;margin:0px;padding:0px;' xmlns=\"http://www.w3.org/1999/xhtml\">";
       }
    else
       {
       echo "<html>";       
       }
    echo "<head>";
    echo "<title>Thread Buddy: " . $thistitle . "</title>";
    echo "</head>";
    
    if (strlen(trim($_GET[tbbackground]))> 0)
        {
        $tb_bgcolor = strip_tags($_GET[tbbackground]);
        }
    else
        {
        $tb_bgcolor = "FFFFFF";
        }
    
    if ($_GET[fullscreen]=="true")
       {
       echo "<body bgcolor='#". $tb_bgcolor ."' style='font-family:arial;margin:0px;padding:0px;height:100%;'>";
       }
    else
       {
       echo "<body bgcolor='#". $tb_bgcolor ."' style='font-family:arial;margin:0px;padding:0px;'>";       
       }
    include("threadbuddy.php");
    echo "</body>";
    echo "</html>";
    }
else
    {
    echo "<html>";
    echo "<head>";
    echo "<title>Thread Buddy: " . $thistitle . "</title>";
    echo "</head>";
    echo "<body bgcolor=#333333 style='font-family:arial;'>";       
    echo "<a  title='Thread Buddy Home' href='http://threadbuddy.com'><img border=0 src='threadbuddybig.gif'></a>";
    echo "<br><br><span class='tbtitle' style='font-size:1.4em;'>&nbsp;Channel: <font color='orange'>" . $thistitle . "</font></span><br><br>";
    include("threadbuddy.php");
    echo "</body>";
    echo "</html>";    
    }
?>
